#include <iostream>
#include <cstring>
#define MAX_NUM 100
#define MAX_LENGTH 1000
using namespace std;

struct Activity{
	int begin;
	int end;
};

int partition(Activity (&act)[MAX_NUM + 1], int begin, int end){
	int i = begin;
	int j = end;
	Activity temp = act[begin];
	while(i < j){
		while(i < j && act[j].begin > temp.begin) j--;
		if(i < j) act[i] = act[j];
		while(i < j && act[i].begin < temp.begin) i++;
		if(i < j) act[j] = act[i];
	}
	act[i] = temp;
	return i;
}

void quickSort(Activity (&act)[MAX_NUM + 1], int begin, int end){
	if(begin < end){
		int p = partition(act, begin, end);
		quickSort(act, begin, p);
		quickSort(act, p+1, end);
	}
}

int main(){
	int n;
	cin >> n;
	Activity act[MAX_NUM + 1];
	for(int i = 1; i <= n; i++)
		cin >> act[i].begin >> act[i].end;
	quickSort(act, 1, n); // sort
	int change[MAX_LENGTH + 1];
	memset(change, 0, sizeof(change));
	int maxn = 0;
	for(int i = 1; i <= n; i++){
		change[act[i].begin]++;
		change[act[i].end]--;
		if(act[i].end > maxn) maxn = act[i].end;
	}
	int result = 0;
	int present = 0;
	for(int i = 0; i <= maxn; i++){
		present += change[i];
		if(result < present) result = present;
	}
	cout << result << endl;
}
